Skip to content

chore: add DeletePrincipalGrantByTuple SQLc query#1885

Open
tgmendes wants to merge 1 commit intomainfrom
tiago/age-1566-remove-grant
Open

chore: add DeletePrincipalGrantByTuple SQLc query#1885
tgmendes wants to merge 1 commit intomainfrom
tiago/age-1566-remove-grant

Conversation

@tgmendes
Copy link
Contributor

@tgmendes tgmendes commented Mar 13, 2026

Summary

  • Adds DeletePrincipalGrantByTuple SQLc query to delete a single grant by its exact (organization_id, principal_urn, scope, resource) tuple
  • This matches the unique constraint on the principal_grants table, enabling precise single-grant removal

Part of AGE-1566.


Open with Devin

Adds a query to delete a single grant by its (org, principal, scope, resource) tuple, matching the unique constraint on the table.
@tgmendes tgmendes requested a review from a team as a code owner March 13, 2026 18:12
@linear
Copy link

linear bot commented Mar 13, 2026

@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment Mar 13, 2026 6:12pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Mar 13, 2026

⚠️ No Changeset found

Latest commit: 9352c9d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +51 to +62
func (q *Queries) DeletePrincipalGrantByTuple(ctx context.Context, arg DeletePrincipalGrantByTupleParams) (int64, error) {
result, err := q.db.Exec(ctx, deletePrincipalGrantByTuple,
arg.OrganizationID,
arg.PrincipalUrn,
arg.Scope,
arg.Resource,
)
if err != nil {
return 0, err
}
return result.RowsAffected(), nil
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 New query has no callers or tests yet

The DeletePrincipalGrantByTuple function is defined but has zero callers anywhere in the codebase and no corresponding tests. The CONTRIBUTING.md guidelines state "Add tests for all new contributions." While this is auto-generated sqlc code and may be a preparatory change for a follow-up PR that will add callers and tests, it's worth confirming this is intentional and that tests will accompany the consuming code.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@disintegrator disintegrator changed the title feat: add DeletePrincipalGrantByTuple SQLc query chore: add DeletePrincipalGrantByTuple SQLc query Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants